<%@page import="javax.faces.context.FacesContext"%>
<%@page import="Adkiraki.Usuario"%>
<%@page contentType="text/html;charset=UTF-8" language="java"%>
<%@page isELIgnored="false"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<f:loadBundle basename="Adkiraki.mensagens" var="msg"/>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>ADKIRAKI©</title>
    <script language="JavaScript" src="${pageContext.request.contextPath}/Pages/JS/Adkiraki.js"></script>
    <link href="${pageContext.request.contextPath}/Pages/CSS/Adkiraki.css" type="text/css" rel="STYLESHEET"></link>    
</head>
<body>
<f:view>
<h:form id="home">                       
    <table>
        <!-- Cabeçalho -->
        <tr>
            <td colspan="4" class="header">
            </td>
        </tr>
        <!-- Menu -->
        <tr>
            <td class="menufake">
            </td>
            <td class="menu">
                <h:outputLink value="/Pages/View/home.jsf"><h:outputText value="Início" styleClass="submenu"/></h:outputLink>                                
            </td>
            <td class="menu">
                <h:outputLink value="/Pages/View/produtos.jsf"><h:outputText value="Produtos" styleClass="submenu"/></h:outputLink>                
            </td>
            <td class="menu">
                <h:outputLink value="/Pages/View/contatos.jsf"><h:outputText value="Contatos" styleClass="submenu"/></h:outputLink>                                                
            </td>
        </tr>
    </table>
    <table>
        <tr id="principal">
            <!-- Login -->
            <td style="width:175px;white-space: nowrap;" valign="top">
                <div class="divlogin">
                    <form method="post" action="">
                      <table width="100%" border="0" cellspacing="0" cellpadding="5">
                          <tr>
                              <td style="width:41%;" class="label">
                                    <%
                                        FacesContext context = FacesContext.getCurrentInstance();
                                        HttpSession session_atual = (HttpSession) context.getExternalContext().getSession(true);
                                        Usuario usuario = (Usuario)session_atual.getAttribute(Usuario.class.getName());
                                    %>
                                  <div style="align: center;">Olá <%=usuario.getLogin()%>!</div>
                              </td>
                          </tr>
                          <tr>
                              <td colspan="2" class="button">
                                    <h:outputLink value="/Pages/View/login.jsf"><h:outputText value="Sair"/></h:outputLink>                                
                              </td>
                          </tr>
                      </table>
                    </form>
                </div>
            </td>
            <td style="width:25px;" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                        </td>
                    </tr>
                </table>
            </td>
            <td style="width:600px;" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="5">
                    <tr>
                        <td>
                            Bem vindos ao ADKIRAKI !!!
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</h:form>
</f:view>                                    
</body>
</html>
